import { createRouter,createWebHashHistory } from 'vue-router'




//首页左侧菜单路由
import homepage_recommended from '@/views/HomePage_Module/homepage_recommended.vue'
import homepage_backend from '@/views/HomePage_Module/homepage_backend.vue'
import homepage_leadingend from '@/views/HomePage_Module/homepage_leadingend.vue'
import homepage_android from '@/views/HomePage_Module/homepage_android.vue'
import homepage_ios from '@/views/HomePage_Module/homepage_ios.vue'
import homepage_ai from '@/views/HomePage_Module/homepage_ai.vue'
import homepage_exploit from '@/views/HomePage_Module/homepage_exploit.vue'
import homepage_code from '@/views/HomePage_Module/homepage_code.vue'
import homepage_read from '@/views/HomePage_Module/homepage_read.vue'

export const HomePageList = [
  {
    path: '/recommended',
    name: 'recommended',
    component: homepage_recommended,
    meta: {title:'综合'}
  },
  {
    path: '/backend',
    name: 'backend',
    component: homepage_backend,
    meta: {title:'后端'}
  },
  {
    path: '/leadingend',
    name: 'leadingend',
    component: homepage_leadingend,
    meta: {title:'前端'}
  },
  {
    path: '/android',
    name: 'android',
    component: homepage_android,
    meta: {title:'Android'}
  },
  {
    path: '/ios',
    name: 'ios',
    component: homepage_ios,
    meta: {title:'iOS'}
  },
  {
    path: '/ai',
    name: 'ai',
    component: homepage_ai,
    meta: {title:'人工智能'}
  },
  {
    path: '/exploit',
    name: 'exploit',
    component: homepage_exploit,
    meta: {title:'开发工具'}
  },
  {
    path: '/code',
    name: 'code',
    component: homepage_code,
    meta: {title:'代码人生'}
  },
  {
    path: '/read',
    name: 'read',
    component: homepage_read,
    meta: {title:'阅读'}
  },
]



//导航栏路由
import HomePage from '../views/HomePage.vue'
import HomeBots from '../views/HomeBots.vue'
export const headerList = [
  {
    path: '/',
    name: 'home',
    component: HomePage,
    children:[
      ...HomePageList
    ],
  },
  {
    path: '/bots',
    name: 'BOT',
    component: HomeBots,
  },
]



export const routesList = [
  ...headerList,
]
const router = createRouter({
  // history:createWebHistory(), //history模式
  history: createWebHashHistory(), //hash模式
  routes: routesList
})


export default router
